#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QtXml/QDomDocument>
#include <QFile>

#include "logger.h"
#include "Serial.h"

namespace Ui  {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT
    
public:
    explicit MainWindow( QWidget *parent = 0 );
    ~MainWindow();

private slots:
    void saveButtonClicked( );
    void tweetButtonClicked( );
    void tweetTextChanged( );
    void aboutButtonClicked( );
    void portTextChanged( QString strText );
    void baudRateChanged( int iIndex );
    void serialConnect( );
protected slots:
    void checkForIncomingData( );

protected:
    void closeEvent( QCloseEvent* pEvent );
    
private:
    QString m_sPort;
    Ui::MainWindow  *ui;
    bool m_bHasSettingsChanged;

    static int s_rgBaudRates[ ]; //place holder for baud rates
    static QString s_qsBaudRates;

    void populateSettings( QDomDocument *pDoc );

    Serial* m_pSerial;
    Logger* m_pLogger;
    QAction* m_pActionExit;
};

#endif // MAINWINDOW_H
